<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false"%>
<%
    String path = request.getContextPath();
%>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title><sitemesh:write property='title'/> - 晟邦物流财务系统</title>
    <base href="<%=path%>/"/>

    <!-- BOOTSTRAP STYLES-->
    <link href="assets/css/bootstrap.css" rel="stylesheet" />
    <!-- FONTAWESOME STYLES-->
    <link href="assets/css/font-awesome.css" rel="stylesheet" />
    <!--CUSTOM BASIC STYLES-->
    <link href="assets/css/basic.css" rel="stylesheet" />
    <!--CUSTOM MAIN STYLES-->
    <link href="assets/css/custom.css" rel="stylesheet" />

    <link href="assets/css/wizard/jquery.steps.css" rel="stylesheet" />

    <!-- GOOGLE FONTS-->
    <link href='assets/fonts/googleapis.css' rel='stylesheet' type='text/css' />
    <link href='assets/bootstrap-datetimepicker/bootstrap-datetimepicker.min.css' rel='stylesheet' type='text/css' />
    <script>
        <c:if test="${empty authUser}">
        (function () {
            location.href="<%=path%>/system/user/login.htm";
        })()
        </c:if>
    </script>

    <script src="assets/js/jquery-1.10.2.js"></script>
    <!-- BOOTSTRAP SCRIPTS -->
    <script src="assets/js/bootstrap.js"></script>
    <script src="assets/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js"></script>
    <!-- METISMENU SCRIPTS -->
    <script src="assets/js/jquery.metisMenu.js"></script>
    <!-- CUSTOM SCRIPTS -->
    <script src="assets/js/custom.js"></script>

    <script src="assets/angular.min.js"></script>
    <script src="static/lib/angular/angular-sanitize.min.js"></script>
    <script src="assets/js/wizard/jquery.steps.js"></script>
    <script src="static/dist/bundle-app.js"></script>

    <link href="assets/bootstrap-toastr/toastr.min.css" rel="stylesheet" />
    <script src="assets/bootstrap-toastr/toastr.min.js"></script>
    <script src="assets/util.js"></script>

    <script src="static/local/progress.js"></script>
    <sitemesh:write property='head'/>
</head>
<body>
<div id="wrapper">
    <%--<div id="top-panel"></div>--%>
    <%--<nav class="navbar navbar-default navbar-cls-top" role="navigation" style="margin-bottom: 0">--%>
    <%--</nav>--%>
    <!-- /. NAV TOP  -->

    <%--<nav class="navbar-default navbar-side" role="navigation">--%>
        <%--<div class="sidebar-collapse">--%>
            <%--<ul class="nav" id="main-menu">--%>
                <%--<li>--%>
                    <%--<a  href="system/user/logout.htm"><i class="fa fa-dashboard "></i>logout</a>--%>
                <%--</li>--%>
            <%--</ul>--%>
        <%--</div>--%>

    <%--</nav>--%>
    <!-- /. NAV SIDE  -->
    <div id="page-wrapper" style="margin: 0 auto">
        <sitemesh:write property='body'/>
        <!-- /. PAGE INNER  -->
    </div>
    <!-- /. PAGE WRAPPER  -->
</div>
<!-- /. WRAPPER  -->
<%--<div id="footer-sec">--%>
    <%--&copy; 2014 YourCompany | More Templates <a href="http://www.cssmoban.com/" target="_blank" title="模板之家">模板之家</a> - Collect from <a href="http://www.cssmoban.com/" title="网页模板" target="_blank">网页模板</a>--%>
<%--</div>--%>

<script>
   (function () {
        //生成菜单
       var fillMenus=function (children) {
           var str="";
           if(children&&children.length>0){
               for(var i in children){
                   var child=children[i];
                   if(child.type != '3' ){
                       var url=child.url?child.url:"javascript:void(0);";
                       if(url.indexOf("/")==0){
                           url=url.substr(1);
                       }
                       str+='<li><a href="'+url+'" class="left-menu" ><i class="fa fa-desktop "></i>'+child.name;
                       if(child && child.children && child.children.length>0){
                           if(child.type=='1'){
                               str+='<span class="fa arrow"></span></a>';
                           }
                           var childrenStr=fillMenus(child.children);
                           if(childrenStr){
                               str+='<ul class="nav nav-second-level">';
                               str+=childrenStr;
                               str+='</ul>';
                           }
                       }else{
                           str+='</a>';
                       }
                       str+='</li>';
                   }

               }
           }
           return str;
       }
        var menu=eval(${menu});
        $("#main-menu").append(fillMenus(menu.children));

        //选中菜单
        $("#main-menu").find("a").attr('class','');
        var url=location.pathname+location.search;
        url=url.replace("<%=path%>/","");
        $("#main-menu").find("a[href='"+url+"']").attr('class','active-menu');
        $("#main-menu").find("a[href='"+url+"']").parent().parent().parent().attr('class','active');
        $("#main-menu").find("a[href='"+url+"']").parent().parent().attr('class','nav nav-second-level collapse in');

    })();
</script>
<%--<script src="/static/dist/bundle-app.js"></script>--%>
<sitemesh:write property='PageFootScript'/>
</body>
</html>
